home *** CD-ROM | disk | FTP | other *** search
Wrap
"FILE"="Xteq Systems X-Setup Plugin 3.1" "TYPE"="9" "COUNT"="1" "UIPATH"="Appearance\Files&Folders\Files" "NAME"="Show/Hide File Extensions" "VERSION"="2.04" "LANGUAGE"="VBScript" "TEXT 1"="Display extension" "DESCRIPTION 1"="This plug-in can be used to hide or show the extensions for some files. For example a file called "XTEQ.URL" would appear as "XTEQ" if you disable the display of the extension." "DESCRIPTION 2"="If the checkbox left from an entry is checked, it means "DISPLAY THE EXTENSION". If unchecked, it means "DO NOT DISPLAY THE EXTENSION"." "AUTHOR"="Xteq Systems" "CONTACTURL"="http://www.xteq.com" "COPYRIGHT"="Copyright ⌐ Xteq Systems - All Rights Reserved" "COMMENT 1"="Thanks to CptSiskoX for his help!" 'ONLY EDIT THE LINE BELOW !!!! '****************************************************************** sVals=Array(".lnk",".pif",".URL",".scf",".shs",".shb",".job",".jse",".vbe",".vbs",".js",".wsf",".doc") '****************************************************************** sPath="HKLM\Software\Classes\" sValue="\NeverShowExt" SUB Plugin_Initialize for i=0 to UBound(sVals) sItem=sVals(i) 'get file description sP=sPath & sItem & "\@" sBase=RegReadValue(sP) if IsEmpty(sBase)=true then 'has no description, don't need to go any further Call SetUI(i+1,sItem,true) else 'HKLM\Software\Classes\XX File\NeverShowEx sP=sPath & sBase & sValue if RegValueExists(sP)=true then 'NeverShowExt found! Call SetUI(i+1,sItem,false) else 'not found Call SetUI(i+1,sItem,true) end if end if next END SUB Sub SetUI(ItemNr,Typ,Activated) sDesc=GetFileDescription(Typ) Call SetUIElement(ItemNr, sDesc & " (" & Typ & ")" ) Call SetUIElementEx(ItemNr,Activated) End Sub 'VERSION 1.1 'returns the readable description for a file TYPE. Input is the 'raw file type (e.g. ".TXT"). Function GetFileDescription(DotType) sxd_BasePath="HKLM\Software\Classes\" sxd_Path=sxd_BasePath & DotType & "\@" sxd_Val=RegReadValue(sxd_Path) if IsEmpty(sxd_Val)=true then 'extended description not found! return default GetFileDescription="<UNKNOWN>" else 'found, now get the "real" description sxd_Path=sxd_BasePath & sxd_Val & "\@" sxd_Name=RegReadValue(sxd_Path) if IsEmpty(sxd_Name)=true then 'argh! GetFileDescription="<UNKNOWN>" else GetFileDescription=sxd_Name end if end if End Function 'Called when the Plugin should apply the changes SUB Plugin_Apply(ElementIndex,ElementSubIndex) for i=0 to UBound(sVals) sItem=sVals(i) 'get file description sP=sPath & sItem & "\@" sBase=RegReadValue(sP) if IsEmpty(sBase)=true then Call MsgError("Unable to set for type " & sItem & " as this type has no description!") else 'HKLM\Software\Classes\XX File\NeverShowEx sP=sPath & sBase & sValue if GetUIElementEx(i+1)=true then 'show extension if RegValueExists(sP) then Call RegDeleteValue(sP) end if else 'hide extension Call RegWriteValue(sP,"",1) end if end if next Call Logoff() END SUB 'Called when the Plugin is about to be removed from memory SUB Plugin_Terminate END SUB